package com.jvav.xml;

import org.dom4j.Document;
import org.dom4j.Node;
import org.dom4j.io.SAXReader;

import java.util.List;

public class TestBook {
    public static void main(String[] args) throws Exception{
        SAXReader reader = new SAXReader();
        Document document = reader.read("F:\\IDEA\\IDEA\\JavaWeb\\jdbc_work\\work2\\src\\com\\jvav\\xml\\books.xml");

        List<Node> list = document.selectNodes("/books/book//*");
        for (Node node : list) {
            System.out.println(node.getName()+" "+node.getText());
        }
    }
    }

